package com.smart.gui;

import java.awt.Font;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.SwingConstants;
import javax.swing.border.EmptyBorder;

import com.jgoodies.forms.factories.FormFactory;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.RowSpec;
import com.smart.core.AppManager.DesiredEnum;

public class Business_Drivers_Part1 extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4142756853545425943L;
	private JPanel contentPane;
	private final JLabel label_2 = new JLabel("4)");

	/**
	 * singleton pattern -- getInstance
	 */
	private static Business_Drivers_Part1 uniqueInstanceForm;

	public static synchronized Business_Drivers_Part1 getInstance() {
		if (uniqueInstanceForm == null) {
			try {
				uniqueInstanceForm = new Business_Drivers_Part1();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return uniqueInstanceForm;
	}

	/**
	 * Create the frame.
	 */
	public Business_Drivers_Part1() {
		ButtonHandler handler = new ButtonHandler(this);

		setTitle("Business Driver Questionnaire -- Part 1");
		setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
		setBounds(25, 25, 651, 599);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
				FormFactory.MIN_COLSPEC,
				FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
				ColumnSpec.decode("default:grow"),
				FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
				FormFactory.MIN_COLSPEC,
				FormFactory.LABEL_COMPONENT_GAP_COLSPEC, }, new RowSpec[] {
				FormFactory.LINE_GAP_ROWSPEC, FormFactory.MIN_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC, FormFactory.MIN_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC, RowSpec.decode("default:grow"),
				FormFactory.LINE_GAP_ROWSPEC, FormFactory.MIN_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC, RowSpec.decode("default:grow"),
				FormFactory.LINE_GAP_ROWSPEC, FormFactory.MIN_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC, RowSpec.decode("default:grow"),
				FormFactory.LINE_GAP_ROWSPEC, FormFactory.MIN_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC, RowSpec.decode("default:grow"),
				FormFactory.LINE_GAP_ROWSPEC, FormFactory.MIN_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC, RowSpec.decode("default:grow"),
				FormFactory.LINE_GAP_ROWSPEC, FormFactory.MIN_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC, RowSpec.decode("default:grow"),
				FormFactory.LINE_GAP_ROWSPEC, FormFactory.MIN_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC, RowSpec.decode("default:grow"),
				FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
				FormFactory.LINE_GAP_ROWSPEC, }));

		JLabel lblNewLabel = new JLabel("Goal and Expectations of Migration");
		lblNewLabel.setHorizontalTextPosition(SwingConstants.LEFT);
		lblNewLabel.setHorizontalAlignment(SwingConstants.LEFT);
		contentPane.add(lblNewLabel, "4, 2, left, center");

		JLabel lblIncludeQuestion = new JLabel("Desirable?");
		contentPane.add(lblIncludeQuestion, "6, 2");

		JLabel label = new JLabel("1)");
		contentPane.add(label, "2, 4, left, default");

		JLabel lblWhatAre = new JLabel(
				"What are the buisness drivers for the migration?");
		lblWhatAre.setHorizontalTextPosition(SwingConstants.LEADING);
		contentPane.add(lblWhatAre, "4, 4");

		JComboBox<DesiredEnum> comboBox = new JComboBox<DesiredEnum>(
				DesiredEnum.values());
		comboBox.setName("comboBox");
		comboBox.setMaximumRowCount(DesiredEnum.values().length);
		comboBox.setEditable(false);
		comboBox.setSelectedItem(DesiredEnum.UNK);
		// Leave this as a template for how to add a listener and routine to
		// execute every time state changes
		// comboBox.addItemListener( new ItemListener()
		// {
		// /**
		// * Called whenever the value of the selection changes. Will
		// * be called twice for every change.
		// * @param e the event that characterizes the change.
		// */
		// public void itemStateChanged( ItemEvent e )
		// {
		// // We don't need to cast because even Object supports toString which
		// we have overridden.
		// String choice = comboBox.getSelectedItem().toString();
		// out.println( choice );
		// }
		// } );
		contentPane.add(comboBox, "6, 4");

		JScrollPane scrollPane = new JScrollPane();
		contentPane.add(scrollPane, "4, 6, 3, 1, fill, fill");

		JTextArea textArea = new JTextArea();
		textArea.setName("textArea");
		textArea.setFont(new Font("Monospaced", Font.PLAIN, 11));
		textArea.setWrapStyleWord(true);
		textArea.setLineWrap(true);
		textArea.setRows(1);
		scrollPane.setViewportView(textArea);

		JLabel label_1 = new JLabel("2)");
		contentPane.add(label_1, "2, 8, left, default");

		JLabel lblHasPriorPilot = new JLabel(
				"Has prior pilot studies been done within the organization for migration of software testing?");
		contentPane.add(lblHasPriorPilot, "4, 8");

		JComboBox<DesiredEnum> comboBox_1 = new JComboBox<DesiredEnum>(
				DesiredEnum.values());
		comboBox_1.setName("comboBox_1");
		comboBox_1.setMaximumRowCount(DesiredEnum.values().length);
		comboBox_1.setEditable(false);
		comboBox_1.setSelectedItem(DesiredEnum.UNK);
		contentPane.add(comboBox_1, "6, 8");

		JScrollPane scrollPane_1 = new JScrollPane();
		contentPane.add(scrollPane_1, "4, 10, 3, 1, fill, fill");

		JTextArea textArea_1 = new JTextArea();
		textArea_1.setName("textArea_1");
		textArea_1.setFont(new Font("Monospaced", Font.PLAIN, 11));
		textArea_1.setWrapStyleWord(true);
		textArea_1.setLineWrap(true);
		textArea_1.setRows(1);
		scrollPane_1.setViewportView(textArea_1);

		JLabel lblNewLabel_1 = new JLabel("3)");
		contentPane.add(lblNewLabel_1, "2, 12, left, default");

		JLabel lblWhatAreThe = new JLabel(
				"What are the expectations from the migration effort?");
		contentPane.add(lblWhatAreThe, "4, 12");

		JComboBox<DesiredEnum> comboBox_2 = new JComboBox<DesiredEnum>(
				DesiredEnum.values());
		comboBox_2.setName("comboBox_2");
		comboBox_2.setMaximumRowCount(DesiredEnum.values().length);
		comboBox_2.setEditable(false);
		comboBox_2.setSelectedItem(DesiredEnum.UNK);
		contentPane.add(comboBox_2, "6, 12");

		JScrollPane scrollPane_2 = new JScrollPane();
		contentPane.add(scrollPane_2, "4, 14, 3, 1, fill, fill");

		JTextArea textArea_2 = new JTextArea();
		textArea_2.setName("textArea_2");
		textArea_2.setFont(new Font("Monospaced", Font.PLAIN, 11));
		textArea_2.setWrapStyleWord(true);
		textArea_2.setLineWrap(true);
		textArea_2.setRows(1);
		scrollPane_2.setViewportView(textArea_2);
		contentPane.add(label_2, "2, 16");

		JLabel lblNewLabel_2 = new JLabel("What are the short-term goals?");
		contentPane.add(lblNewLabel_2, "4, 16");

		JComboBox<DesiredEnum> comboBox_3 = new JComboBox<DesiredEnum>(
				DesiredEnum.values());
		comboBox_3.setName("comboBox_3");
		comboBox_3.setMaximumRowCount(DesiredEnum.values().length);
		comboBox_3.setEditable(false);
		comboBox_3.setSelectedItem(DesiredEnum.UNK);
		contentPane.add(comboBox_3, "6, 16, fill, default");

		JScrollPane scrollPane_3 = new JScrollPane();
		contentPane.add(scrollPane_3, "4, 18, 3, 1, fill, fill");

		JTextArea textArea_3 = new JTextArea();
		textArea_3.setName("textArea_3");
		textArea_3.setFont(new Font("Monospaced", Font.PLAIN, 11));
		textArea_3.setWrapStyleWord(true);
		textArea_3.setLineWrap(true);
		textArea_3.setRows(1);
		scrollPane_3.setViewportView(textArea_3);

		JLabel label_3 = new JLabel("5)");
		contentPane.add(label_3, "2, 20");

		JLabel lblWhatAreThe_1 = new JLabel("What are the log-term goals?");
		contentPane.add(lblWhatAreThe_1, "4, 20");

		JComboBox<DesiredEnum> comboBox_4 = new JComboBox<DesiredEnum>(
				DesiredEnum.values());
		comboBox_4.setName("comboBox_4");
		comboBox_4.setMaximumRowCount(DesiredEnum.values().length);
		comboBox_4.setEditable(false);
		comboBox_4.setSelectedItem(DesiredEnum.UNK);
		contentPane.add(comboBox_4, "6, 20, fill, default");

		JScrollPane scrollPane_4 = new JScrollPane();
		contentPane.add(scrollPane_4, "4, 22, 3, 1, fill, fill");

		JTextArea textArea_4 = new JTextArea();
		textArea_4.setName("textArea_4");
		textArea_4.setFont(new Font("Monospaced", Font.PLAIN, 11));
		textArea_4.setWrapStyleWord(true);
		textArea_4.setLineWrap(true);
		textArea_4.setRows(1);
		scrollPane_4.setViewportView(textArea_4);

		JLabel label_4 = new JLabel("6)");
		contentPane.add(label_4, "2, 24");

		JLabel lblWhatArePerceived = new JLabel(
				"What are perceived advantages in migrating testing to the  cloud?");
		contentPane.add(lblWhatArePerceived, "4, 24");

		JComboBox<DesiredEnum> comboBox_5 = new JComboBox<DesiredEnum>(
				DesiredEnum.values());
		comboBox_5.setName("comboBox_5");
		comboBox_5.setMaximumRowCount(DesiredEnum.values().length);
		comboBox_5.setEditable(false);
		comboBox_5.setSelectedItem(DesiredEnum.UNK);
		contentPane.add(comboBox_5, "6, 24, fill, default");

		JScrollPane scrollPane_5 = new JScrollPane();
		contentPane.add(scrollPane_5, "4, 26, 3, 1, fill, fill");

		JTextArea textArea_5 = new JTextArea();
		textArea_5.setName("textArea_5");
		textArea_5.setFont(new Font("Monospaced", Font.PLAIN, 11));
		textArea_5.setWrapStyleWord(true);
		textArea_5.setLineWrap(true);
		textArea_5.setRows(1);
		scrollPane_5.setViewportView(textArea_5);

		JLabel label_5 = new JLabel("7)");
		contentPane.add(label_5, "2, 28");

		JLabel lblWhatArePerceived_1 = new JLabel(
				"What are perceived disadvantages in migrating testing to the cloud?");
		contentPane.add(lblWhatArePerceived_1, "4, 28");

		JComboBox<DesiredEnum> comboBox_6 = new JComboBox<DesiredEnum>(
				DesiredEnum.values());
		comboBox_6.setName("comboBox_6");
		comboBox_6.setMaximumRowCount(DesiredEnum.values().length);
		comboBox_6.setEditable(false);
		comboBox_6.setSelectedItem(DesiredEnum.UNK);
		contentPane.add(comboBox_6, "6, 28, fill, default");

		JScrollPane scrollPane_6 = new JScrollPane();
		contentPane.add(scrollPane_6, "4, 30, 3, 1, fill, fill");

		JTextArea textArea_6 = new JTextArea();
		textArea_6.setName("textArea_6");
		textArea_6.setFont(new Font("Monospaced", Font.PLAIN, 11));
		textArea_6.setWrapStyleWord(true);
		textArea_6.setLineWrap(true);
		textArea_6.setRows(1);
		scrollPane_6.setViewportView(textArea_6);

		JButton btnSave = new JButton("Save");
		btnSave.setActionCommand(ButtonHandler.SAVE);
		btnSave.addActionListener(handler);
		contentPane.add(btnSave, "1, 32, 6, 1");
	}

}
